package cn.tedu.sp04.order.feignclient;

import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import cn.tedu.sp01.pojo.Item;
import cn.tedu.sp01.pojo.User;
import cn.tedu.web.util.JsonResult;

@FeignClient(name="user-service",fallback = UserFeignServiceFB.class)
public interface UserFeignService {
	@GetMapping("/{userId}")
	public JsonResult<User> getUser(@PathVariable Integer userId);
	/**
	 * e.g. URL=http://localhost:8101/7/score?score=100
	 * @param userId
	 * @param score
	 * @return
	 */
	@GetMapping("/{userId}/score")
	public JsonResult addScore(@PathVariable Integer userId,@RequestParam Integer score);
}
